package com.cts.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 
 * @author tongshengchen
 * @TableName exception_log
 */
@TableName(value ="exception_log")
@Data
@NoArgsConstructor
public class ExceptionLog implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 请求接口
     */
    @TableField(value = "uri")
    private String uri;

    /**
     * 请求方式
     */
    @TableField(value = "method")
    private String method;

    /**
     * 请求参数
     */
    @TableField(value = "param")
    private String param;

    /**
     * 操作描述
     */
    @TableField(value = "description")
    private String description;

    /**
     * 异常信息
     */
    @TableField(value = "error")
    private String error;

    /**
     * ip
     */
    @TableField(value = "ip")
    private String ip;

    /**
     * ip来源
     */
    @TableField(value = "ip_source")
    private String ipSource;

    /**
     * 操作系统
     */
    @TableField(value = "os")
    private String os;

    /**
     * 浏览器
     */
    @TableField(value = "browser")
    private String browser;

    /**
     * 操作时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * user-agent用户代理
     */
    @TableField(value = "user_agent")
    private String userAgent;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public ExceptionLog (String uri, String method, String description, String ip, String error, String ipSource, String os, String browser, String userAgent) {
        this.uri = uri;
        this.method = method;
        this.description = description;
        this.ip = ip;
        this.error = error;
        this.ipSource = ipSource;
        this.os = os;
        this.browser = browser;
        this.userAgent = userAgent;
    }
}